home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
printing
/
rlpr-1.000
/
rlpr-1
/
rlpr-1.13
/
rlpr-common.h
< prev
next >
Wrap
C/C++ Source or Header
|
1996-06-30
|
4KB
|
100 lines
/* filename: rlpr-common.h
* project: rlpr
* author: meem -- meem@sherilyn.wustl.edu
* version: $Id: rlpr-common.h,v 1.4 1996/07/01 01:06:35 meem Exp $
* contents: common #defines, headers for general-purpose rlpr functions
*
* Time-stamp: <1996/06/30 20:08 -- meem@sherilyn>
*/
#ifndef RLPR_COMMON_H
#define RLPR_COMMON_H
#include <errno.h>
#ifdef sparc
#include <netdb.h> /* braindamage for MAXHOSTNAMELEN */
#else /* NOT sparc */
#include <sys/param.h>
#endif
#define VERSION "1.13"
/* this is the port the proxy listens on (rlprd) and the client
* connects to to contact the proxy. it can be whatever you want
* as long as the client and the server are both in agreement.
* note that putting it below 1024 is asinine.
*/
#define RLPRD_TO_NUM 7290
/* reliable and writeable temp directory */
#define TMPDIR "/tmp/"
/* environment variable names */
#define PRINTHOST "RLPR_PRINTHOST"
#define PROXY "RLPR_PROXY"
/* i made these up because i couldn't find a good source for them */
#define MAX_STR_LEN 255
#define MAX_FILE_LEN 64 /* NOT DEFINED IN RFC 1179! */
#define MAX_QUEUE_LEN 64 /* NOT DEFINED IN RFC 1179! */
/* NOTHING BELOW THIS POINT SHOULD NEED TO BE CHANGED */
/* FROM RFC 1179 */
#define MAX_USER_LEN 31
#define MAX_SOURCE_LEN 131
#define MAX_HOST_LEN 31
#define MAX_JOB_LEN 99
#define MAX_CLASS_LEN 31
#define MAX_TITLE_LEN 79
#define LO_LPD_FROM_NUM 721 /* INCLUSIVE */
#define HI_LPD_FROM_NUM 731 /* INCLUSIVE */
#define LPD_TO_NUM 515
/* odds and ends */
#define ERRNO (strerror(errno))
/* printing attributes struct */
typedef struct print_attr_ {
char filetype; /* format of file to print */
int fflag:1; /* form feed after printing? */
int mflag:1; /* mail after printing? */
int rflag:1; /* remove file after printing? */
int bflag:1; /* burst page flag (1 = print it) */
int qflag:1; /* quiet flag (1 = quiet) */
int wflag:1; /* windows flag (for braindead lpd's) */
unsigned int icols; /* number of cols to indent with -i */
unsigned int copies; /* number of copies to print*/
unsigned int width; /* width of page */
/* these fields are MAX + 1 so they can hold the null byte */
char currhost[MAXHOSTNAMELEN+1]; /* hostname we're currently on */
char proxyhost[MAXHOSTNAMELEN+1]; /* hostname of proxy to go through */
char printhost[MAXHOSTNAMELEN+1]; /* hostname of printer to print to */
char class[MAX_CLASS_LEN+1]; /* job classification on burst page */
char printer[MAX_QUEUE_LEN+1]; /* name of printer queue */
char user[MAX_USER_LEN+1]; /* user name to print on burst page */
char job[MAX_JOB_LEN+1]; /* job name to print on burst page */
char title[MAX_TITLE_LEN+1]; /* title (optional for pr) */
} print_attr; /* convenience */
/* global variables */
char *name; /* argv[0] */
char local_hostname[MAXHOSTNAMELEN]; /* host rlpr client is on */
int sockfd; /* socket we're using */
print_attr opts_; /* global options struct */
/* function prototypes */
void rlpr_fatal(char *fmt, ...); /* print a fatal error message */
void rlpr_warn(char *fmt, ...); /* print a warning */
void get_local_hostname(void); /* get local hostname */
void strlower(char *str); /* lowercase a string */
off_t filesz(int fd); /* find size of a file */
#endif /* RLPR_COMMON_H */